<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>商城设置</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  {include file="public/css"/}
</head>
<body>
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-card layui-col-md12">
				<div class="layui-card-header"><i class="fa fa-cog"></i> 商城设置</div>
				<div class="layui-card-body" pad15>
					<div class="layui-form" lay-filter="">
						<!-- <div class="layui-form-item">
							<label class="layui-form-label" style="width:130px">商城标题：</label>
							<div class="layui-input-inline">
								<input type="text" name="info[name]" lay-verify="required" lay-verType="tips" class="layui-input" value="{$info['name']}">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:130px">商城LOGO：</label>
							<input type="hidden" name="info[logo]" id="logo" class="layui-input" value="{$info['logo']}">
							<button style="float:left;" type="button" class="layui-btn layui-btn-primary" upload-input="logo" upload-preview="logoPreview" onclick="uploader(this)">上传图片</button>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">建议尺寸：400×400像素</div>
							<div id="logoPreview" style="float:left;padding-top:10px;margin-left:130px;clear: both;">
								<div class="layui-imgbox" style="width:130px;"><div class="layui-imgbox-img"><img src="{$info['logo']}"/></div></div>
							</div>
						</div> -->
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:130px">自动收货天数：</label>
							<div class="layui-input-inline">
								<input type="text" name="info[autoshdays]" lay-verify="required" lay-verType="tips" class="layui-input" value="{$info.autoshdays}">
							</div>
							<div class="layui-form-mid">天</div>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">发货后多少天用户未确认收货自动完成收货</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:130px">自动关闭订单：</label>
							<div class="layui-input-inline">
								<input type="text" name="info[autoclose]" lay-verify="required" lay-verType="tips" class="layui-input" value="{$info.autoclose}">
							</div>
							<div class="layui-form-mid">分钟</div>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">下单后多久不支付自动关闭订单，释放占用的库存</div>
						</div>
						
						<!-- <div class="layui-form-item">
							<label class="layui-form-label" style="width:130px">{:t('积分')}规则：</label>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">消费每满</div>
							<div class="layui-input-inline" style="width: 100px;">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[scorein_money]" class="layui-input" value="{$info.scorein_money}">
							</div>
							<div class="layui-form-mid">元</div>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">赠送</div>
							<div class="layui-input-inline" style="width: 100px;">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[scorein_score]" class="layui-input" value="{$info.scorein_score}">
							</div>
							<div class="layui-form-mid">{:t('积分')}</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:130px"></label>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">每{:t('积分')}抵扣</div>
							<div class="layui-input-inline" style="width: 100px;">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[score2money]" class="layui-input" value="{$info.score2money}">
							</div>
							<div class="layui-form-mid">元</div>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">一个{:t('积分')}可抵扣多少元</div>
						</div> -->
						
						<!-- <div class="layui-form-item">
							<label class="layui-form-label" style="width:130px">满额包邮：</label>
							<div class="layui-input-inline">
								<input type="radio" name="info[freightfree]" value="1" {if $info['freightfree']==1}checked{/if} title="开启" lay-filter="freightfree"/>
								<input type="radio" name="info[freightfree]" value="0" {if $info['freightfree']==0}checked{/if} title="关闭" lay-filter="freightfree"/>
							</div>
						</div>
						<div class="layui-form-item" id="freightfreemoneyset" {if $info['freightfree']==0}style="display:none"{/if}>
							<label class="layui-form-label" style="width:130px"></label>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">单笔满</div>
							<div class="layui-input-inline" style="width: 100px;">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[freightfreemoney]" class="layui-input" value="{$info['freightfreemoney']}">
							</div>
							<div class="layui-form-mid">元包邮</div>
						</div> -->
						

						<div class="layui-form-item">
							<label class="layui-form-label" style="width:130px">货到付款：</label>
							<div class="layui-input-inline">
								<input type="radio" name="info[cancod]" value="1" {if $info['cancod']==1}checked{/if} title="开启" lay-filter="cancodset"/>
								<input type="radio" name="info[cancod]" value="0" {if $info['cancod']==0}checked{/if} title="关闭" lay-filter="cancodset"/>
							</div>
							<div style="float:left;{if !$info['id'] || $info['cancod']==0}display:none{/if}" id="cancodset">
								<div class="layui-form-mid">自定义文字</div>
								<div class="layui-input-inline" style="width:100px"><input type="text" name="info[codtxt]" value="{$info.codtxt}" class="layui-input"></div>
							</div>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">开启后支付时可以选择货到付款</div>
						</div>
						{if getcustom('pay_month')}
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:130px">月结账户：</label>
							<div class="layui-input-inline">
								<input type="radio" name="info[pay_month]" value="1" {if $info['pay_month']==1}checked{/if} title="开启" lay-filter="pay_monthset"/>
								<input type="radio" name="info[pay_month]" value="0" {if $info['pay_month']==0}checked{/if} title="关闭" lay-filter="pay_monthset"/>
							</div>
							<div style="float:left;{if !$info['id'] || $info['pay_month']==0}display:none{/if}" id="pay_monthset_show">
								<div class="layui-form-mid">自定义文字</div>
								<div class="layui-input-inline" style="width:100px"><input type="text" name="info[pay_month_txt]" value="{$info.pay_month_txt}" class="layui-input"></div>
							</div>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">开启后支付时可以选择月结账户</div>
						</div>
						{/if}
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:130px">购物车推荐：</label>
							<div class="layui-input-inline">
								<input type="radio" name="info[gwctj]" value="1" {if $info['gwctj']==1}checked{/if} title="开启"/>
								<input type="radio" name="info[gwctj]" value="0" {if $info['gwctj']==0}checked{/if} title="关闭"/>
							</div>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">开启后购物车显示为您推荐</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:130px">退款退货：</label>
							<div class="layui-input-inline">
								<input type="radio" name="info[canrefund]" value="1" {if $info['canrefund']==1}checked{/if} title="开启"/>
								<input type="radio" name="info[canrefund]" value="0" {if $info['canrefund']==0}checked{/if} title="关闭"/>
							</div>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">关闭后用户无法申请退款退货</div>
						</div>

					<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
						<legend>商品评价</legend>
					</fieldset>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:130px">商品评价：</label>
							<div class="layui-input-inline">
								<input type="radio" name="info[comment]" value="1" {if $info['comment']==1}checked{/if} title="开启" lay-filter="comment"/>
								<input type="radio" name="info[comment]" value="0" {if $info['comment']==0}checked{/if} title="关闭" lay-filter="comment"/>
							</div>
						</div>
						<div class="layui-form-item" id="commentset" {if $info['comment']==0}style="display:none"{/if}>
							<label class="layui-form-label" style="width:130px">评价审核：</label>
							<div class="layui-input-inline">
								<input type="radio" name="info[comment_check]" value="1" {if $info['comment_check']==1}checked{/if} title="开启" lay-filter="comment_check"/>
								<input type="radio" name="info[comment_check]" value="0" {if $info['comment_check']==0}checked{/if} title="关闭" lay-filter="comment_check"/>
							</div>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">关闭后用户的评价将直接显示,不需要后台审核</div>
						</div>

					<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
						<legend>详情页显示</legend>
					</fieldset>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:130px">是否显示店铺信息：</label>
							<div class="layui-input-inline">
								<input type="radio" name="info[showjd]" value="1" {if $info['showjd']==1}checked{/if} title="显示"/>
								<input type="radio" name="info[showjd]" value="0" {if $info['showjd']==0}checked{/if} title="不显示"/>
							</div>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">开启后商品详情页显示店铺信息</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:130px">是否显示{:t('佣金')}：</label>
							<div class="layui-input-inline">
								<input type="radio" name="info[showcommission]" value="1" {if $info['showcommission']==1}checked{/if} title="显示"/>
								<input type="radio" name="info[showcommission]" value="0" {if $info['showcommission']==0}checked{/if} title="不显示"/>
							</div>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">开启后商品详情页显示分销{:t('佣金')}</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:130px">是否显示销量：</label>
							<div class="layui-input-inline">
								<input type="radio" name="info[hide_sales]" value="0" {if $info['hide_sales']==0}checked{/if} title="显示"/>
								<input type="radio" name="info[hide_sales]" value="1" {if $info['hide_sales']==1}checked{/if} title="不显示"/>
							</div>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">关闭后商品列表及详情不显示销量</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:130px">是否显示库存：</label>
							<div class="layui-input-inline">
								<input type="radio" name="info[hide_stock]" value="0" {if $info['hide_stock']==0}checked{/if} title="显示"/>
								<input type="radio" name="info[hide_stock]" value="1" {if $info['hide_stock']==1}checked{/if} title="不显示"/>
							</div>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">关闭后商品列表及详情不显示库存</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:130px">是否显示升级优惠：</label>
							<div class="layui-input-inline">
								<input type="radio" name="info[show_lvupsavemoney]" value="1" {if $info['show_lvupsavemoney']==1}checked{/if} title="显示"/>
								<input type="radio" name="info[show_lvupsavemoney]" value="0" {if $info['show_lvupsavemoney']==0}checked{/if} title="不显示"/>
							</div>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">商品详情页是否显示升级到下一级可节省多少元</div>
						</div>
						<!-- <div class="layui-form-item">
							<label class="layui-form-label" style="width:130px">收货地址强制定位：</label>
							<div class="layui-input-inline">
								<input type="radio" name="info[needzb]" value="1" {if $info['needzb']==1}checked{/if} title="开启"/>
								<input type="radio" name="info[needzb]" value="0" {if $info['needzb']==0}checked{/if} title="关闭"/>
							</div>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">配送方式如果有同城配送请开启</div>
						</div> -->
						{if getcustom('to86yk')}
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:130px">对接账号：</label>
							<div class="layui-input-inline">
								<input type="text" name="info[to86yk_user]" class="layui-input" value="{$info['to86yk_user']}">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:130px">对接密码：</label>
							<div class="layui-input-inline">
								<input type="text" name="info[to86yk_pwd]" class="layui-input" value="{$info['to86yk_pwd']}">
							</div>
						</div>
						{/if}
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:130px">送货单打印标题：</label>
							<div class="layui-input-inline">
								<input type="text" name="info[shipping_pagetitle]" class="layui-input" value="{$info['shipping_pagetitle']}">
							</div>
						</div>
						{if getcustom('coupon_peruselimit')}
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:130px">单笔订单最多可用：</label>
							<div class="layui-input-inline">
								<input type="text" name="info[coupon_peruselimit]" lay-verify="required" lay-verType="tips" class="layui-input" value="{$info.coupon_peruselimit}">
							</div>
							<div class="layui-form-mid">张{:t('优惠券')}</div>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;"></div>
						</div>
						{/if}
						
						{if getcustom('ngmm')}
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:130px">广告图1：</label>
							<input type="hidden" name="info[detail_guangao1]" id="detail_guangao1" lay-verType="tips" class="layui-input" value="{$info.detail_guangao1}">
							<button style="float:left;" type="button" class="layui-btn layui-btn-primary" upload-input="detail_guangao1" upload-preview="detail_guangao1Preview" onclick="uploader(this)">上传图片</button>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">建议尺寸：800*200像素</div>
							<div id="detail_guangao1Preview" style="float:left;padding-top:10px;padding-left:160px;clear: both;">
								<div class="layui-imgbox" style="width:200px;height:50px;"><div class="layui-imgbox-img"><img src="{$info.detail_guangao1}"/></div></div>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:130px">广告图1弹窗：</label>
							<input type="hidden" name="info[detail_guangao1_t]" id="detail_guangao1_t" lay-verType="tips" class="layui-input" value="{$info.detail_guangao1_t}">
							<button style="float:left;" type="button" class="layui-btn layui-btn-primary" upload-input="detail_guangao1_t" upload-preview="detail_guangao1_tPreview" onclick="uploader(this)">上传图片</button>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">建议尺寸：600*600像素</div>
							<div id="detail_guangao1_tPreview" style="float:left;padding-top:10px;padding-left:160px;clear: both;">
								<div class="layui-imgbox" style="width:100px;"><div class="layui-imgbox-img"><img src="{$info.detail_guangao1_t}"/></div></div>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:130px">广告图2：</label>
							<input type="hidden" name="info[detail_guangao2]" id="detail_guangao2" lay-verType="tips" class="layui-input" value="{$info.detail_guangao2}">
							<button style="float:left;" type="button" class="layui-btn layui-btn-primary" upload-input="detail_guangao2" upload-preview="detail_guangao2Preview" onclick="uploader(this)">上传图片</button>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">建议尺寸：800*200像素</div>
							<div id="detail_guangao2Preview" style="float:left;padding-top:10px;padding-left:160px;clear: both;">
								<div class="layui-imgbox" style="width:200px;height:50px;"><div class="layui-imgbox-img"><img src="{$info.detail_guangao2}"/></div></div>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:130px">广告图2弹窗：</label>
							<input type="hidden" name="info[detail_guangao2_t]" id="detail_guangao2_t" lay-verType="tips" class="layui-input" value="{$info.detail_guangao2_t}">
							<button style="float:left;" type="button" class="layui-btn layui-btn-primary" upload-input="detail_guangao2_t" upload-preview="detail_guangao2_tPreview" onclick="uploader(this)">上传图片</button>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">建议尺寸：600*600像素</div>
							<div id="detail_guangao2_tPreview" style="float:left;padding-top:10px;padding-left:160px;clear: both;">
								<div class="layui-imgbox" style="width:100px;"><div class="layui-imgbox-img"><img src="{$info.detail_guangao2_t}"/></div></div>
							</div>
						</div>
						{/if}
						{if getcustom('probgcolor')}
							<div class="layui-form-item">
								<label class="layui-form-label" style="width:130px">订单详情顶部图：</label>
								<input type="hidden" name="info[order_detail_toppic]" id="order_detail_toppic" lay-verType="tips" class="layui-input" value="{$info.order_detail_toppic}">
								<button style="float:left;" type="button" class="layui-btn layui-btn-primary" upload-input="order_detail_toppic" upload-preview="orderdetailpicPreview" onclick="uploader(this)">上传图片</button>
								<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">建议尺寸：750*220像素</div>
								<div id="orderdetailpicPreview" style="float:left;padding-top:10px;padding-left:160px;clear: both;">
									<div class="layui-imgbox" style="width:100px;"><div class="layui-imgbox-img"><img src="{$info.order_detail_toppic}"/></div></div>
								</div>
							</div>
						{/if}
						<div class="layui-form-item">
							<div class="layui-input-block" style="margin-left:160px;">
								<button class="layui-btn" lay-submit lay-filter="formsubmit">提 交</button>
							</div>
						</div>
					</div>
				</div>
			</div>
    </div>
  </div>
	{include file="public/js"/}
	<script>
	layui.form.on('radio(cancodset)', function(data){
		if(data.value == '1'){
			$('#cancodset').show();
		}else{
			$('#cancodset').hide();
		}
	})
	layui.form.on('radio(pay_monthset)', function(data){
		if(data.value == '1'){
			$('#pay_monthset_show').show();
		}else{
			$('#pay_monthset_show').hide();
		}
	})
	layui.form.on('radio(freightfree)', function(data){
		if(data.value == '1'){
			$('#freightfreemoneyset').show();
		}else{
			$('#freightfreemoneyset').hide();
		}
	})

	layui.form.on('radio(comment)', function(data){
		if(data.value == '1'){
			$('#commentset').show();
		}else{
			$('#commentset').hide();
		}
	})
	layui.form.on('submit(formsubmit)', function(obj){
		var field = obj.field
		if(field['info[logo]'] == ''){
			dialog('请上传商家LOGO',0);return;
		}
		$.post("{:url('save')}",field,function(data){
			dialog(data.msg,data.status,data.url);
		})
	})
  </script>
	{include file="public/copyright"/}
</body>
</html>